# !/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
===========================
@Time : 2022/11/1 0001 21:50
@Author : 测试开发工程师
@File : hasattr_demo.py
@Software: PyCharm
============================
"""


class Cat:

    def __init__(self, name):
        self.name = name


if __name__ == '__main__':
    apple = Cat('apple')
    print(hasattr(apple, 'name'))  # True
    print(hasattr(apple, 'age'))  # False
